package kr.hkit.powerjava.chther20;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArraysEx {
	public static void main(String[] args) {
		ArrayList<Integer>  arList = new ArrayList<>();
		for (int i = 0; i < 11; i++) {
			arList.add(i);
			
		}
		for (int a : arList) {
			System.out.printf("%-3d",a);
		}
		System.out.println();
		for (int a  : arList) {
			System.out.printf("%3d",a);
			
		}
		
		int[] arr = new int[10];
		for (int i = 0; i < 10; i++) {
			arr[i] = i+1;
		}
		System.out.println();
		List<Integer> list = Arrays.asList(1,2,3,4,5,6,7);
		for(int i=0; i<list.size();i++){
			System.out.print(list.get(i));
		}
		System.out.println();
		for (int a : arr) {
			System.out.printf("%3d",a);
			
		}
		int idx= Arrays.binarySearch(arr, 11);
		System.out.println("\n5의위치는"+idx);
		
		boolean[] lotto = new boolean[45];
		Arrays.fill(lotto, true);
		for(boolean b : lotto){
			System.out.print(b+" ");
		}
		
		
		
		
		
		
	/*	int[] array ={9,4,5,6,2,1};
		Arrays.sort(array);
		printArray(array);
		System.out.print(Arrays.binarySearch(array, 9));
		Arrays.fill(array, 8);
		printArray(array);*/
	}

	/*private static void printArray(int[] array) {
		// TODO Auto-generated method stub
		System.out.print("[");
		for (int i = 0; i < array.length; i++) {
			System.out.print(array[i]+"");
			System.out.print("]");
		}
	}*/
}
